FROM 10.10.50.203:5001/dut-water/conda-xarray-data-base

LABEL maintainer="Gaoyu <gaoyu.ssdut@icloud.com>"

# 设置环境变量
ENV PATH /root/miniconda3/bin:/root/miniconda3/condabin:$PATH
RUN echo $PATH
RUN apt-get update
RUN apt-get install git -y
RUN apt-get install vim -y

# 工作目录
WORKDIR /app
COPY . /app

# docker时区问题
# RUN cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
# pip安装依赖包
# COPY requirements_app.txt /tmp/requirements_docker.txt
# RUN ["pip", "install","--default-timeout=100", "-r", "/tmp/requirements_docker.txt","--trusted-host","10.48.0.87","--index-url","http://10.48.0.87:8931/repository/pypi-public/simple"]
# RUN pip install -r requirements_docker.txt --index-url https://pypi.tuna.tsinghua.edu.cn/simple

# EXPOSE 8000

# CMD ["nohup", "python", "main.py", "&"]

COPY requirements.txt /tmp/requirements_docker.txt
RUN ["pip", "install","--default-timeout=100", "-r", "/tmp/requirements_docker.txt","--index-url","https://pypi.tuna.tsinghua.edu.cn/simple"]
RUN ["pip", "install", "torch==2.1.2", "torchvision==0.16.2", "torchaudio==2.1.2", "--index-url", "https://download.pytorch.org/whl/cpu"]

CMD ["uvicorn", "neimeng_service:app", "--host", "0.0.0.0", "--port", "8199", "--reload"]

# CMD ["tail", "-f", "/dev/null"]

# image
# docker build -f Dockerfile -t neimeng_service:new .
# container
# docker run --restart=always --name neimeng_service -d --network=host neimeng_service:new
#docker run --restart=always --name neimeng -d -p 8200:8199 neimeng_service:latset